package com.aistar.controller;

import com.aistar.pojo.pojoOV.ProductFavoritsOV;
import com.aistar.service.FavoritsService;
import com.aistar.util.ServerResponse;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class FavoritsController {
    @Autowired
    FavoritsService service;

    @RequestMapping("/collection")
    public String order(){
        return "collection/collection";
    }

    @GetMapping("/collection/customer/{id}")
    @ResponseBody
    public ServerResponse getCollectionByPage
            (@PathVariable("id")Integer cusId) {

        ServerResponse serverResponse = service.getAllFavorits(cusId);
        return serverResponse;
    }


}
